import { defHttp } from '/@/utils/http/axios';

enum Api {
  list = '/api-uaa/online/list',
  delete = '/api-uaa/oauth/remove/token',
}

/**
 * 查询在线用户列表
 * @param params
 */
export const getOnlineUserList = (params) => {
  return defHttp.get({ url: Api.list, params });
};

/**
 * 删除TOKEN
 * @param params
 */
export const deleteToken = (accessToken, handleSuccess) => {
  const params = {
    token: accessToken,
  };
  return defHttp.get({ url: Api.delete, data: params }, { joinParamsToUrl: true }).then(() => {
    handleSuccess();
  });
};
